package org.langqiao.experiment.experiment4;
public class Triangle extends Graphics{

	private double a,b,c;
	
	public Triangle(String shape, double a, double b, double c) {
		super(shape);
		this.a = a;
		this.b = b;
		this.c = c;
	}
	
	public double area() {
		double p=(a+b+c)/2;
		return Math.sqrt(p*(p-a)*(p-b)*(p-c));
	}

	public double perimeter() {
		return a+b+c;
	}
	
	public static void main(String []args){
		new Triangle("三角形",4,3,5).print();
	}

	
}
